package com.thf.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.thf.model.NewsModels;
import com.thf.model.ProductModels;
import com.thf.model.ResultData;
import com.thf.service.NewsService;
import com.thf.service.ProductService;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class ProductController {

    @Resource
    private ProductService productService;
    @RequestMapping("/product")
    public ResultData<Page<ProductModels>> findAndPage(@Param("pageNo") Integer pageNo , @Param("pageSize") Integer pageSize){
        System.out.println("====================>"+pageNo);
        System.out.println("====================>"+pageSize);
        //反馈给前端--返回值
        return new ResultData<>(0, productService.page(new Page<>(pageNo, pageSize)));
    }
}
